package com.richapp.launcher.control;


import com.key.virtual.ir.InputKeyValueJni;

/**
 * Created by jack on 2015/4/1 0001.
 *
 */
public class ControlProcess {

    private int cmd[]={0xc1cf/*power按键*/,0xd212/*弹出菜单*/,0xe334/*向上*/,0x64f5/*向左*/,
            0xf540/*向右*/,0xc660/*确认*/,0xa720/*向下*/,0x9870/*返回上页*/,
            0x89d0/*静音*/,0x7ac0/*返回主页*/,0x6ba0/*声音加*/,0x5ce0/*声音减*/,0x6dff/*进入屏保*/,0x8ecc/*退出屏保*/};

    private static final String TAG = ControlProcess.class.getName();
    private static ControlProcess controlProcess;
    public static  int CONTROL_CMDS[]={
            0xc1cf/*0 power按键*/,
            0xd212/*1 弹出菜单*/,
            0xe334/*2 向上*/,
            0x64f5/*3 向左*/,
            0xf540/*4 向右*/,
            0xc660/*5 确认*/,
            0xa720/*6 向下*/,
            0x9870/*7 返回上页*/,
            0x89d0/*8 静音*/,
            0x7ac0/*9 返回主页*/,
            0x6ba0/*10 声音加*/,
            0x5ce0/*11 声音减*/,
            0x6dff/*进入屏保*/,
            0x8ecc/*退出屏保*/
    };

    private  ControlProcess(){

    }

    public static ControlProcess getInstance(){
        if(controlProcess == null){
            InputKeyValueJni.initJNI();
            controlProcess = new ControlProcess();
        }
        return controlProcess;
    }

    public void  doCommand(int command){
        if( command >= 0 && command <= 11){
            InputKeyValueJni.inputkey(CONTROL_CMDS[command]);
        }else{
            //未定义的指令
        }
    }
}
